function VecResultsDateTotal=ComputeDates(VecResultsDateTotal,ValueYear,ValueMonth,ValueDay,n1)

ValueTotalTemp=VecResultsDateTotal{1,n1};
if isnan(ValueTotalTemp)==1
    VecResultsDateTotal(1,n1)={[ValueYear ValueMonth ValueDay]};
else
    if ValueYear<ValueTotalTemp(1,1)
        VecResultsDateTotal(1,n1)={[ValueYear ValueMonth ValueDay]};
    else
        if ValueYear==ValueTotalTemp(1,1)&&ValueMonth<ValueTotalTemp(1,2)
            VecResultsDateTotal(1,n1)={[ValueYear ValueMonth ValueDay]};
        end
    end  
end